package com.xkcoding.orm.mybatis.plus.generator.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xkcoding.orm.mybatis.plus.generator.entity.User;
import com.xkcoding.orm.mybatis.plus.generator.mapper.UserMapper;
import com.xkcoding.orm.mybatis.plus.generator.service.UserService;
import dto.QueryDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

/**
 * <p>
 * User Service
 * </p>
 *
 * @author yangkai.shen
 * @date Created in 2018-11-08 18:10
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User queryByCondition(QueryDto queryDto) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return userMapper.queryByCondition(queryDto);
    }
}
